package parttwo.homework;

/**
 * 通话套餐类
 */
public class TalkingPackage implements TalkingService{
    private double    allTalkingTime; //通话时长
    private int       allMessageNum;  //短信条数
    private double    allPlan;        //每月资费

//  有参的构造方法
    public TalkingPackage(double allTalkingTime, int allMessageNum, double allPlan) {
        setAllMessageNum(allMessageNum);
        setAllPlan(allPlan);
        setAllTalkingTime(allTalkingTime);
    }
//  无参的构造方法
    public TalkingPackage() {
    }
//  提供set get 方法
    public double getAllTalkingTime() {
        return allTalkingTime;
    }
    public void setAllTalkingTime(double allTalkingTime) {
        this.allTalkingTime = allTalkingTime;
    }
    public int getAllMessageNum() {
        return allMessageNum;
    }
    public void setAllMessageNum(int allMessageNum) {
        this.allMessageNum = allMessageNum;
    }
    public double getAllPlan() {
        return allPlan;
    }
    public void setAllPlan(double allPlan) {
        this.allPlan = allPlan;
    }
    /*public void printMsg(){
        System.out.println("本套餐中，通话时长为："+this.allTalkingTime+
                "分钟/n/t短信条数为："+this.allMessageNum+"条/n/t每月资费为："+this.allPlan+"元");

    }*/
//  重写TalkingServier 接口的方法。
    @Override
    public void show(double allTalkingTime, MobilePhoneCard mobilePhoneCard) {
        System.out.println("本套餐中，通话时长为："+getAllTalkingTime()+
                "分钟/n/t短信条数为："+getAllMessageNum()+"条/n/t每月资费为："+getAllPlan()+"元");
    }
}
